/*
    This file is part of Slydini.

    Slydini is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Slydini is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Slydini.  If not, see <http://www.gnu.org/licenses/>.
*/
/* 
 * File:   hand.h
 * Author: kajetan
 *
 * Created on 28 marzec 2009, 13:55
 */

#ifndef _HAND_H
#define	_HAND_H

#define TIP first
#define ACTIVE second

#include "myellipse.h"
#include <utility>

using namespace std;

class Hand
{
private:
	pair<MyEllipse, bool> fingers[2];	
public:

	Hand() {
		fingers[0].ACTIVE = false;
		fingers[1].ACTIVE = false;
	}
	Hand(const MyEllipse& e1, const MyEllipse& e2, bool f1=false, bool f2=false) { 
		fingers[0].ACTIVE = f1;
		fingers[1].ACTIVE = f2;
		fingers[0].TIP = e1;
		fingers[1].TIP = e2;		
	}
	Hand(const Hand& f) { 
		fingers[0] = f.fingers[0];
		fingers[1] = f.fingers[1];
	}

	void operator=(const Hand& f) { 
		fingers[0] = f.fingers[0];
		fingers[1] = f.fingers[1];
	}

	pair<MyEllipse, bool>& operator[](int t) {
		return fingers[t];
	}

	void clear() {
		fingers[0].ACTIVE = false;
		fingers[1].ACTIVE = false;		 
	}

	bool empty() {
		return (!fingers[0].ACTIVE && !fingers[1].ACTIVE);
	}
};

#endif
